#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
void yanghui(int(*arr)[4], int k)
{
	int i = 0;
	int j = 0;

	for (i = 0; i < k; i++)
	{
	
		for (j = 0; j <= i; j++)
		{
			if ((j == 0) || (i == j))
			{
				arr[i][j] = 1;
				
			}
			else
			{
				arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j];

			}
		}
		
	}
}
int main()
{
	int k = 4;
	int arr[4][4] = { 0 };
	yanghui(arr,k);
	int i = 0;
	for (i = 0; i < k; i++)
	{
		int j = 0;
		for (j = 0; j <= i; j++)
		{
			printf("%d ", arr[i][j]);
		}
		printf("\n");
	}
	return 0;
}